package strategy;

/**
 * @author wcj
 * @Date 2021/6/24 21:59
 * @Version 1.0
 */
public class Context {

    private Strategy strategy = null;

    public Context(String button) {
        switch (button) {
            case "O":
                strategy = new NormalBullet();
                break;
            case "I":
                strategy = new RocketBullet();
                break;
            case "P":
                strategy = new FireBullet();
                break;
            default:
                strategy = new NormalBullet();
        }
    }

    public void launch() {
        strategy.launchBullet();
    }
}
